<template>
  <router-layout>
    <div class="container van-hairline--top">
      <div class="content-box">
        <div class="head-box">
          <div class="img-box">
            <img
              :src="info.portrait?info.portrait:'https://gw.alicdn.com/tfs/TB15Q0lOmzqK1RjSZFHXXb3CpXa-400-400.png'"
              width="100%"
              height="100%"
              alt
            >
          </div>
          <p>{{info.user_name}}</p>
        </div>
        <div class="form-box">
          <van-cell-group>
            <van-cell title="我的贴子" @click="onClick(1)">
              <img
                class="img-icon"
                slot="icon"
                src="https://gw.alicdn.com/tfs/TB1mbtMOhnaK1RjSZFBXXcW7VXa-48-50.png"
              >
              <i slot="right-icon" class="iconfont icon-gengduo"></i>
            </van-cell>
            <van-cell title="我的收藏" @click="onClick(2)">
              <img
                class="img-icon"
                slot="icon"
                src="https://gw.alicdn.com/tfs/TB1qBtpOjTpK1RjSZKPXXa3UpXa-48-50.png"
              >
              <i slot="right-icon" class="iconfont icon-gengduo"></i>
            </van-cell>
            <van-cell title="评论我的" @click="go_comment">
              <img
                class="img-icon"
                slot="icon"
                src="https://gw.alicdn.com/tfs/TB1GQ5lbe3tHKVjSZSgXXX4QFXa-48-50.png"
              >
              <i slot="right-icon" class="iconfont icon-gengduo"></i>
            </van-cell>
            <van-cell title="赞我的" @click="go_fabulous">
              <img
                class="img-icon"
                slot="icon"
                src="https://gw.alicdn.com/tfs/TB1H04pOkzoK1RjSZFlXXai4VXa-48-50.png"
              >
              <i slot="right-icon" class="iconfont icon-gengduo"></i>
            </van-cell>
          </van-cell-group>
        </div>
      </div>
    </div>
  </router-layout>
</template>

<script>
import TitleItem from "../../components/public/title/title";
export default {
  components: { TitleItem },
  data() {
    return {
      value: "",
      info: {}
    };
  },
  methods: {
    onClick(e) {
      this.$router.push({
        path: "/MyPost",
        query: {
          id: e
        }
      });
    },
    go_comment() {
      this.$router.push({
        path: "/commentMy",
        query: {
          name: "article"
        }
      });
    },
    go_fabulous() {
      this.$router.push({
        path: "/fabulousMy"
      });
    }
  },
  created() {
    this.info = JSON.parse(localStorage.getItem("user"));
  },
  mounted() {
    this.info = JSON.parse(localStorage.getItem("user"));
  }
};
</script>

<style lang="scss" scoped>
@import "CommunityMy";
</style>

